<%@ page language="java" import="com.anhry.app.safety.util.Util" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>运城市安全生产隐患排查治理信息系统</title>
<style type="text/css">
body {margin:0px; padding:0px;background-color:#fff; background:url(images/bg.gif) repeat-x;font-size:12px; text-align:center;}
.login{ margin:0px auto; padding:0px auto;background:url(images/login_bg.jpg) no-repeat; width:1022px; height:537px;}
.login_info{float:left;margin-left:600px;margin-top:174px; width:260px; height:112px; color:#5186b2; text-align:left;}
.login_info h1{float:left;width:250px;height:32px;font-size:12px; font-weight:normal;margin:0px; padding:0px;padding-top:2px;vertical-align:middle;}
.login_info h2{float:left;width:260px;height:23px;font-size:12px; font-weight:normal;margin:0px; padding:0px; padding-top:2px;vertical-align:middle;}
.login_info h2 img{ vertical-align:middle; padding-left:10px;}
.input{background:url(images/lg_input_bg.gif) no-repeat;width:190px; border:0px; height:32px; line-height:32px;vertical-align:middle;margin-left:5px;padding:0px 10px; }
.input1{background:url(images/lg_input_bg2.gif) no-repeat;width:109px; border:0px; height:32px;line-height:32px;vertical-align:middle;margin-left:5px;margin-right:5px;padding:0px 10px;}
.login_info h3{ float:left; padding-left:50px;margin-top:20px;}
.login_info h3 input{float:left;width:64px; height:26px;margin:0px; padding:0px;padding-top:8px;vertical-align:middle; margin-left:10px;}
.sum{background:url(images/login.gif) no-repeat; border:0px;}
.ret{background:url(images/login2.gif) no-repeat; border:0px;}
.foot{height:89px; text-align:center; line-height:23px; color:#666;padding-top:10px;}
</style>
<script type="text/javascript" src="<%=basePath%>/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="<%=basePath%>/js/jquery.cookie.js"></script>
	<script type="text/javascript" src="<%=basePath %>/js/dbdialog/lhgdialog.min.js?self=false&<%=Util.DIALOG_SKIN %>"></script>
	<script type="text/javascript">
	$(function() {
		 var username = $.cookie('username');  
		 if(username != null) {
		 	//alert(username);
		 	$("#username").val(username);
		 	 $('#checkUsername').attr('checked', true);  
		 }
	});

		function msgDialog(msg, iconName) {
			$.dialog({
		  		lock: true,
		  		title: '操作提示',width: '250px', height:'100px',
			    content: msg,
			    max: false, min: false,
			    icon: iconName,  ok: true
			});
		}
		
		function waitingDialog() {
	$.dialog({
		lock: true,
		title: '正在提交,请稍候',
	    width: '160px',
	    height: '60px',
	    content: 'wait.....',
	    icon:'loading.gif',
	    resize:false,
	    esc:false,
	    min:false,
	    max:false,
	    drag: false,
	    cancel:false
	});	
}

	   	//点击刷新验证码
		function randRefresh(img,baseUrl){
	    		img.src = ""; //不加这句刷新不生效
	    		img.src =baseUrl + "/img.action?"+Math.random();
	    }
    	function checkspace(checkstr) {
			var str = '';
			for(i = 0; i < checkstr.length; i++) {
				str = str + ' ';
			}
			return (str == checkstr);
		}
    	function check(){
    		var username = document.loginform.loginName.value;
			if(checkspace(document.loginform.loginName.value))  {		
				msgDialog("对不起，用户名不能为空，请重新输入！", "hits.png");
				document.loginform.loginName.focus();
				return false;
			}	
			if(checkspace(document.loginform.password.value))  {		
				msgDialog("对不起，密码不能为空，请重新输入！", "hits.png");
				document.loginform.password.focus();
				return false;
			}
			if(checkspace(document.loginform.rand.value))  {		
				msgDialog("对不起，验证码不能为空，请重新输入！", "hits.png");
				document.loginform.rand.focus();
				return false;
			}
			if($('#checkUsername').attr('checked')){  
                    $.cookie('username', username, {expires:30});  
                }else{  
                    $.cookie('username', null);  
                }  
			return true;
		}
	</script>
</head>
<body>
<form id="loginform" name="loginform" action="<%=basePath%>/login/login.action" method="post" >
	<div class="login">
	<img src="images/login_title.png"/>
		<div class="login_info">
		
			<h1>用户名：<input id="username" name="loginName"  class="input"></h1>
			<h1>密　码：<input id="passowrd" type=password name="password" class="input" value="123456"></h1>
			<h2>验证码：<input id=rand class=input1 name=rand><span id="inrandspan"><img 
			style="CURSOR: hand" onclick="javascript:randRefresh(this,'<%=basePath%>');" alt="看不清，换一张图片" 
			src="<%=basePath%>/img.action"/></span></h2>
			<h2><input type="checkbox" name="remember" id="checkUsername" value="1"/>记住用户名 </h2>
			<h3><input type="submit" class="sum" value="" onclick="return check();"><input  type="reset"  class="ret" value=""></h3>
			</div>		
		</div>
</form>
	<div class="foot">
		版权所有：运城市安全生产监督管理局<br/>技术支持：山西宇宏科技有限公司　  咨询电话：0359-2096948 <br/>
		(请使用IE7 或IE7以上版本的浏览器访问本系统)
	</div>
</body>
<s:if test="%{tip!=null}">
	<script>
		msgDialog('${tip}', 'hits.png');
	</script>
</s:if>
</html>
